﻿using System.Web.UI.WebControls;
namespace Library.WebControls.SimpleGridView {
	public class ExportingHeaderArgs : ExportArgs {
		internal ExportingHeaderArgs(SpGridView gridView, PlaceHolder content, Table table)
			: base(gridView, content, table) {
		}

		public bool Handled { get; set; }
		public TableRow DefaultHeaderRow() {
			var header = new TableRow();
			Grid.HeaderRowStyle.ExportStyle.CopyStyleToRow(header);
			foreach (var column in Grid.VisibleColumns) {
				var cell = new TableCell();
				column.HeaderExportStyle.CopyStyleToCell(cell);
				cell.Text = column.Caption;
				header.Cells.Add(cell);
			}
			return header;
		}
	}
}
